package im.dhc.gitdiff.common;

import java.io.BufferedWriter;
import java.io.IOException;

/**
 * @author songhaichao
 * @create 2020-06-09-11:11
 **/
public class ModifyDiffHandler extends AbstractDiffHandler{


    public ModifyDiffHandler(String oldPath, String newPath, BufferedWriter backupbw, BufferedWriter updatebw, BufferedWriter recoverbw) throws Exception {
        super(oldPath,newPath,backupbw,updatebw,recoverbw);
    }

    public void backupHandle() throws IOException {
        backupbw.write(backUp());
        backupbw.newLine();
    }

    public void updateHandle() throws IOException {
        updatebw.write(update());
        updatebw.newLine();
    }

    public void recoverHandle() throws IOException {
        recoverbw.write(recover());
        recoverbw.newLine();
    }

    public void copyFileHandle() throws IOException {
        copyFile();
    }
}
